<?php

namespace app\admin\model\shop\goods;

use app\shop\library\ShopHelper;
use think\Model;

/**
 * ParamsTemplate
 */
class ParamsTemplate extends Model
{
    // 表名
    protected $name = 'shop_goods_params_template';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = true;

    public function getValueAttr($value): array
    {
        return ShopHelper::json_to_array($value);
    }

    public function setValueAttr($value): string
    {
        return ShopHelper::array_to_json($value);
    }
}